package com.glory.dmegcpda.fragment

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.glory.dmegcpda.R
import com.glory.dmegcpda.view.*
import com.glory.dmegcpda.viewmodel.FirstFragmentModel
import com.glory.mvvmnet.base.BaseFragment
import kotlinx.android.synthetic.main.gttext_fragment.*

class GtTextFragment : BaseFragment<FirstFragmentModel>(), View.OnClickListener {



    override fun layoutId(): Int {
        return R.layout.gttext_fragment
    }

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        scribingLine.setOnClickListener(this)
        weldingLine.setOnClickListener(this)
        llBindBattery.setOnClickListener(this)
        llMaterialReceive.setOnClickListener(this)
        llLotInventory.setOnClickListener(this)
    }

    override fun initData() {
        super.initData()

    }

    override fun onClick(view: View?) {
        val intent = Intent()
        when (view) {
            scribingLine -> {
                activity?.let { intent.setClass(it, ScribingActivity::class.java) }
            }
            weldingLine -> {
                activity?.let { intent.setClass(it, WeldingActivity::class.java) }
            }
            llBindBattery ->{
                activity?.let { intent.setClass(it, BindBatteryActivity::class.java) }
            }
            llMaterialReceive ->{
                activity?.let { intent.setClass(it, MaterialReceiveActivity::class.java) }
            }
            llLotInventory ->{
                activity?.let { intent.setClass(it, LotInventoryActivity::class.java) }
            }
        }
        startActivity(intent)
    }
}